<?php
namespace App\Repositories\Seek;

use App\Models\Seek\Clud;
use App\Repositories\BaseRepository;
use App\Exceptions\OrdinaryException;

class CludRepository extends BaseRepository {

    public function model()
    {
        // TODO: Implement model() method.
        return Clud::class;
    }

    /**
     * 插入关联表
     *
     * @author zx
     * @date 2019-01-25
     * @param array $data 参数包
     * @param int $nid 需求关联ID
     * @return Boolean
     */
    public function addClud(array $data, int $nid)
    {
        $array = [];
        $array['nid'] = $nid;
        $array['lon'] = $data['lon'];
        $array['lat'] = $data['lat'];
        $array['date'] = $data['date'];
        $array['time'] = $data['time'];
        $res = $this->create($array);
        if ($res) return true;
        return false;
    }

    public function serialization(array $attributes)
    {
        // TODO: Implement serialization() method.
    }

}